//
// Light.cpp for  in /home/herpec_j/Dropbox/Projets/raytracer-2016/Sources/Lights/
//
// Made by Jonathan
// Login   <ledey_l@epitech.net>
//
// Started on  Tue Sep 24 23:53:25 2013 Jonathan
// Last update Wed Sep 25 00:56:24 2013 Jonathan
//

#include	"Lights/Light.hpp"

namespace	Lights
{
  Light::Light(void) : mRadianceScale(1.0), mDirection(), mColor(1.0)
  {
    return;
  }

  Light::Light(Light const &rOther) : mRadianceScale(rOther.mRadianceScale), mDirection(rOther.mDirection), mColor(rOther.mColor)
  {
    return;
  }

  Light		&Light::operator=(Light const &rOther)
  {
    if (this != &rOther)
      {
    	mRadianceScale = rOther.mRadianceScale;
	mDirection = rOther.mDirection;
	mColor = rOther.mColor;
      }
    return (*this);
  }

  void		Light::ScaleRadiance(long double rValue)
  {
    mRadianceScale = rValue;
  }

  void		Light::SetColor(long double rColor)
  {
    mColor = Maths::Color(rColor);
  }

  void		Light::SetColor(Maths::Color const &rColor)
  {
    mColor = rColor;
  }

  void		Light::SetColor(long double rR, long double rG, long double rB)
  {
    mColor = Maths::Color(rR, rG, rB);
  }

  void		Light::SetDirection(Maths::Vector const &rDirection)
  {
    mDirection = rDirection;
    mDirection.Normalize();
  }

  void		Light::SetDirection(long double rX, long double rY, long double rZ)
  {
    mDirection = Maths::Vector(rX, rY, rZ);
    mDirection.Normalize();
  }

  Maths::Vector	Light::GetDirection(Maths::ShadeRec const &rShadeRec __attribute__((__unused__))) const
  {
    return (mDirection);
  }

  Maths::Color	Light::GetRadiance(Maths::ShadeRec const &rShadeRec __attribute__((__unused__))) const
  {
    return (mRadianceScale * mColor);
  }

  Light::~Light(void)
  {
    return;
  }
};
